package cn.com.chengmandian.service.erp.constants;

public enum DingDingMsgTypeEnum {

    TEXT("text","文本信息"),
    IMAGE("image","图片消息"),
    VOICE("voice","语音消息"),
    FILE("file","文件消息"),
    LINK("link","链接消息");

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static DingDingMsgTypeEnum getNameByCode(String code){
        if(code == null){
            return null;
        }else{
            DingDingMsgTypeEnum[] values = values();
            for(DingDingMsgTypeEnum dingDingMsgTypeEnum :values){
                if(dingDingMsgTypeEnum.getCode().equals(code)){
                    return dingDingMsgTypeEnum;
                }
            }
        }
        return null;
    }

    DingDingMsgTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
